<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<script src="../../js/mui.min.js"></script>
		<link href="../../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="../../css/style.css" />
	</head>

	<body class="public-fff-bgcolor">
		<!--头部导航-->
		<header class="mui-bar mui-bar-nav wx-nav-bgcolor public-ny-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"><br />
			</a>
			<h1 class="mui-title">设置服务器地址</h1>
		</header>
		<div class="mui-content public-fff-bgcolor public-padding public-margin">
			<form class="mui-input-group public-before-none" style="margin-top:10px;">
				<div class="mui-input-row ">

					<input type="text" class="mui-input-clear" placeholder="">
				</div>

			</form>
			<button class="public-block-btn" id="btn">更新</button>

		</div>
		<script src="../../js/iBase.js"></script>
		<script>
			iBase.init();
			iBase.closeStartPage();
				iBase.dblclickExit();
				localStorage.setItem('request_url', "http://39.106.48.20:9999");
			// 登录相关代码
			// 获得元素
			var btn = iBase.id('btn');
			var input = iBase.tagName('input');
			//console.log(localStorage.getItem('request_url'));
			input['0'].value = localStorage.getItem('request_url');
			//登录操作
			iBase.click(btn, function() {
				// 获取账号和密码
				var addr = input['0'].value;
				//判断
				if(addr == '') {
					iBase.prompt('地址不能为空');
					return;
				}

				//显示等待框
				//iBase.showWaiting();
				localStorage.setItem('request_url', addr);
				localStorage.removeItem('username');
				//iBase.closeWaiting();
				iBase.prompt('更新成功，1s后将重启应用');
				mui.plusReady(function() {
					setTimeout(function() {
						plus.runtime.restart();
					}, 1000);

				});
				//iBase.dblclickExit();
			});
		</script>
	</body>

</html>